<?php
/**
 * <https://y.st./>
 * Copyright © 2019 Alex Yst <mailto:copyright@y.st>
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <https://www.gnu.org./licenses/>.
**/
use \st\y\calendar;

$xhtml = array(
	'<{title}>' => 'My calendar',
	'<{subtitle}>' => 'Upcoming events in my life',
	'<{copyright year}>' => '2019',
	'<{body}>' => <<<END
<p>
	I use this calendar to keep track of what&apos;s coming up in my life.
	Go ahead and ignore it.
	Most of this isn&apos;t going to matter to you.
	Feel free to take a look if you&apos;re for some reason interested though.
</p>

END
);
$year = 2019;
$month = 4;
while($year < 2020 or $month < 9):
	$xhtml['<{body}>'] .= <<<END
<div class="graphical-calendar">
	<h2>$year-$month</h2>

END;
	foreach(new calendar($year, $month) as $week):
	$xhtml['<{body}>'] .= <<<END
	<div>

END;
		foreach($week as $datetime):
			$xhtml['<{body}>'] .= <<<END
		<div>
			
		</div>

END;
		endforeach;
		$xhtml['<{body}>'] .= <<<END
	</div>

END;
	endforeach;
	$xhtml['<{body}>'] .= "</div>\n";

	$month++;
	if($month == 13):
		$year++;
		$month = 1;
	endif;
endwhile;
